package Demo01.Tesk.Demo03;

public class Test01 {
    public static void main(String[] args) {
        ArrayBuilder ab = new ArrayBuilder() {
            @Override
            public int[] buildArray(int length) {
                return new int[length];
            }
        };
        getIntegerArray(20,ab);

    }

    public static void getIntegerArray(int length , ArrayBuilder builder){
        int[] arr = builder.buildArray(length);
        System.out.println(arr);
    }
}

@FunctionalInterface
interface ArrayBuilder{
    int [] buildArray(int length);
}
